#include "dominion.h"
#include "dominion_helpers.h"
#include <string.h>
#include <stdio.h>
#include <assert.h>
#include "rngs.h"

#define NOISY_TEST 1

void checkCouncil_room_card(struct gameState *pre) {
  struct gameState post;
  int i;
  memcpy (&post, pre, sizeof(struct gameState));
  for(i=0; i<post.numPlayers; i++) {
    post.handCount[i] = 5;
  }
  post.hand[0][0] = council_room;
  playCard(0, 0, 0, 0, &post);
  printf("player 1 plays council room\n");
  printf("player 1 expected hand count: 8, actual: %d\n", post.handCount[0]);
  assert(post.handCount[0] == 8);
  printf("player 1 expected buy count: 2, actual: %d\n", post.numBuys);
  assert(post.numBuys == 2);
  printf("player 1 expected remaining actions: 0, actual: %d\n", post.numActions);
  assert(post.numActions == 0);
  printf("player 1 expected played card counts: 1, actual: %d\n", post.playedCardCount);
  assert(post.playedCardCount == 1);
  printf("player 2 expected hand count: 6, actual: %d\n", post.handCount[1]);
  assert(post.handCount[1] == 6);
  printf("player 3 expected hand count: 6, actual: %d\n", post.handCount[2]);
  assert(post.handCount[2] == 6);
  printf("player 4 expected hand count: 6, actual: %d\n", post.handCount[3]);
  assert(post.handCount[3] == 6);
}

int test_card5() {
  int k[10] = {adventurer, council_room, feast, gardens, mine,
	       remodel, smithy, village, baron, great_hall};
  struct gameState G;
  printf ("FIXED TESTING Council Room Card.\n");
  initializeGame(4, k, 1, &G);
  checkCouncil_room_card(&G);
  printf ("ALL TESTS OK\n");
  return 0;
}
